<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Wax, "Watin And eXcel" - User guide</title>
    <link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
    <h1>Wax, "Watin And eXcel" - User guide</h1>
    <small>Version 1.0.0.4  of Wax, released 12th October 2007. Copyright &copy; 2007 Edward Wilde, <a href="http://www.duarteconsulting.co.uk">Duarte Consulting</a></small>
    <h2><a name="introduction">Introduction</a></h2>
    <p>There are 4 basic categories of commands:</p>
    <ul>
        <li><a href="#action_commands">Action commands</a> - used for interacting with the browser, setting values, clicking buttons etc...</li>
        <li><a href="#assert_commands">Assertion commands</a> (validation) commands - used for validating document object model values meet expected criteria.</li>
        <li><a href="#dialog_commands">Dialog commands</a> commands used for interacting with Internet  Explorer dialogs, such as javascript prompts, login boxes etc...</li>
        <li><a href="#settings_commands">Settings commands</a> commands used to change the default Watin Settings...</li>
    </ul>
    <p>Many commands are performed against a specific element of the HTML page. Inorder to carry out such a command the method to locate the element must be specified using a find method</p>
    <ul>
        <li><a href="#findmethods">Find Methods</a></li>
    </ul>
    <h2><a name="action_commands">Action commands</a></h2>
    <table title="Action commands table">
        <caption>List of available action commands</caption>
        <thead>
            <tr>
                <th>Name</th>
                <th>Arguments</th>
                <th>Find method</th>
                <th>Description</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="table_item_def"><a href="#action_appendtext" title="see example">AppendText</a></td>
                <td>Text to append</td>
                <td>Required</td>
                <td>Appends text to a given text input field.</td>
            </tr>            
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_attachtoie" title="see example">AttachToIE</a></td>
                <td></td>
                <td>Required</td>
                <td>Attaches to an exisintg instance of internet explorer that matches the passed in document title</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_back" title="see example">Back</a></td>
                <td></td>
                <td></td>
                <td>Navigates to the previous page in the browser history</td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_bringtofront" title="see example">BringToFront</a></td>
                <td></td>
                <td></td>
                <td>Brings the current browser window to the foreground.</td>
            </tr>            
            <tr>
                <td class="table_item_def"><a href="#action_clearcache" title="see example">ClearCache</a></td>
                <td></td>
                <td></td>
                <td>Clears the browser cache, best called before using other commands.</td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_clearcookies" title="see example">ClearCookies</a></td>
                <td>Url (optional)</td>
                <td></td>
                <td>Clears the browser cookies, either for a given url or all cookies.</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_cleartext" title="see example">ClearText</a></td>
                <td></td>
                <td>Required</td>
                <td>Clears the value for the text input element specified by the <span class="italic">find method</span></td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_click" title="see example">Click</a></td>
                <td></td>
                <td>Required</td>
                <td>Triggers the click event for the element specified by the <span class="italic">find method</span></td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_close" title="see example">Close</a></td>
                <td></td>
                <td></td>
                <td>Closes the browser</td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_doubleclick" title="see example">DoubleClick</a></td>
                <td></td>
                <td>Required</td>
                <td>Triggers the double click event for the element specified by the <span class="italic">find method</span></td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_flash" title="see example">Flash</a></td>
                <td></td>
                <td>Required</td>
                <td>Causes the selected browser element to flash</td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_focus" title="see example">Focus</a></td>
                <td></td>
                <td>Required</td>
                <td>Sets focus to a given element</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_forward" title="see example">Forward</a></td>
                <td></td>
                <td></td>
                <td>Navigates to the next page in the browser history</td>
            </tr>    
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_getcookie" title="see example">GetCookie</a></td>
                <td>Url, cookie name</td>
                <td></td>
                <td>Gets the cookie for the specified <span class="italic">Url</span> and <span class="italic">cookie name</span>.
                 Used in combination with the <a href"#action_validatelastfound">ValidateLastFound</a> command.
                </td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_goto" title="see example">Goto</a></td>
                <td>Url</td>
                <td></td>
                <td>Navigates to the Url specified in the <span class="italic">command arguments</span></td>
            </tr>         
            <tr>
                <td class="table_item_def"><a href="#action_presstab" title="see example">PressTab</a></td>
                <td></td>
                <td></td>
                <td>Presses the tab key moving focus to the next element in the tab order.</td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_refresh" title="see example">Refresh</a></td>
                <td></td>
                <td></td>
                <td>Causes the current browser window to refresh.</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_screenshot" title="see example">Screenshot</a></td>
                <td>File name</td>
                <td></td>
                <td>Creates an image of the current web page and saves it to disk.</td>
            </tr>
            <tr  class="alternate_row">
                <td class="table_item_def"><a href="#action_selecttext" title="see example">SelectText</a></td>
                <td></td>
                <td>Required</td>
                <td>Selects the text for the identified text input element.</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_setcookie" title="see example">SetCookie</a></td>
                <td>Url,cookie data</td>
                <td></td>
                <td>Sets a cookie for the specified <span class="italic">domain</span>, The cookie data of the form: &lt;name&gt;=&lt;value&gt;[; &lt;name&gt;=&lt;value&gt;]... [; expires=&lt;date:DAY, DD-MMM-YYYY HH:MM:SS GMT&gt;][; domain=&lt;domain_name&gt;] [; path=&lt;some_path&gt;][; secure][; httponly].</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_setvalue" title="see example">SetValue</a></td>
                <td>Value,property name</td>
                <td>Required</td>
                <td>Sets the value for the element specified by the <span class="italic">find method</span>, using the value given in the <span class="italic">command arguments</span></td>
            </tr>  
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_setvalues" title="see example">SetValues</a></td>
                <td>Values (comma seperated), property name</td>
                <td>Required</td>
                <td>Sets multiple values for the element specified by the <span class="italic">find method</span>, using the value given in the <span class="italic">command arguments</span> commonly used with a selected list that has the <span class="italic">multiple</span> attribute.</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_typetext" title="see example">TypeText</a></td>
                <td>Text to type</td>
                <td>Required</td>
                <td>Types text for a given text field.</td>
            </tr>            
        </tbody>
    </table>
    <h3>Examples using the action command</h3>
    <h3><a name="action_appendtext">AppendText</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdAppendText
    Command:        AppendText
    CommandArgs:    Eddie
    FindMethod:     ById
    FindArgs        txtFirstName
    </pre>
    <p><img alt="Example of the append text command in Excel." src="action_appendtext.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will append text to the text field control identified by the id <span class="italic">txtFirstName</span>. 
     If element with this id is found or the element is not a text field control, the test will fail.
    </blockquote>
    
    <h3><a name="action_attachtoie">AttachToIE</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdAttachToIE1
    Command:        AttachToIE
    CommandArgs:    {not applicable}
    FindMethod:     ByTitle
    FindArgs        Welcome to CodePlex
    </pre>
    <p><img alt="Example of the AttachToIE command in Excel." src="action_attachtoie.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will attach to the first instance of Internet Explorer that has the page title "Welcome to CodePlex". 
     If no instance of Internet Explorer is found, with that document title, the test will fail.
    </blockquote>
    
    <h3><a name="action_back">Back</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdGoBack
    Command:        Back
    CommandArgs:    {not applicable}
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p><img alt="Example of the back command in Excel." src="action_back.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will navigate to the previous page in the browser's history.
    </blockquote>
    
    <h3><a name="action_bringtofront">BringToFront</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdBringToFront
    Command:        BringToFront
    CommandArgs:    {not applicable}
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p><img alt="Example of the bring to front command in Excel." src="action_bringtofront.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will cause the current browser window to come to the foreground.
    </blockquote>
    
    <h3><a name="action_clearcache">ClearCache</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdClearCache
    Command:        ClearCache
    CommandArgs:    {not applicable}
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p><img alt="Example of the clear cache command in Excel." src="action_clearcache.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will clear the browser cache.
    </blockquote>
    
    <h3><a name="action_clearcookies">ClearCookies</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdClearCookies
    Command:        ClearCookies
    CommandArgs:    http://www.google.com
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p><img alt="Example of the clear cookies command in Excel." src="action_clearcookies.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will clear all cookies for the url http://www.google.com.
    </blockquote>
    
    <h3><a name="action_cleartext">ClearText</a> <a href="#action_commands" class="goto_tsop">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdClearText
    Command:        ClearText
    CommandArgs:    {not applicable}
    FindMethod:     ById
    FindArgs        txtFirstName
    </pre>
    <p><img alt="Example of the clear text command in Excel." src="action_cleartext.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example look for a browser element with that has the id <span class="italic">txtFirstName</span>, it will clear the value for that text input field. The test will fail if an element can not be found for that id, or if the element found is not an text input element.
    </blockquote>
    
    <h3><a name="action_click">Click</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdSubmitLoginForm
    Command:        Click
    CommandArgs:    {not applicable}
    FindMethod:     ById
    FindArgs        btnOkay
    </pre>
    <p><img alt="Example of the Click command in Excel." src="action_click.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example look for a browser element with that has the id <span class="italic">btnOkay</span>, it will then fire that element's click event. The test will fail if an element can not be found for that id.
    </blockquote>
    
    <h3><a name="action_close">Close</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdCloseBrowser
    Command:        Close
    CommandArgs:    {not applicable}
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p><img alt="Example of the close command in Excel." src="action_close.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example closes the browser the current test is attached to.
    </blockquote>
    
    <h3><a name="action_doubleclick">DoubleClick</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdPopUp
    Command:        DoubleClick
    CommandArgs:    {not applicable}
    FindMethod:     ByValue
    FindArgs        Title
    </pre>
    <p><img alt="Example of the DoubleClick command in Excel." src="action_doubleclick.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example look for a browser element with that has the value <span class="italic">Title</span>, it will then fire that element's double click event. The test will fail if an element can not be found for that value.
    </blockquote>
    
    <h3><a name="action_flash">Flash</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdFalshElement
    Command:        Flash
    CommandArgs:    {not applicable}
    FindMethod:     ById
    FindArgs        txtLastName
    </pre>
    <p><img alt="Example of the flash command in Excel." src="action_flash.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will cause the browser element with the id <span class="italic">txtLastName</span> to flash. The test will fail if no element with that id is found.
    </blockquote>
    
    <h3><a name="action_focus">Focus</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdFocusElement
    Command:        Focus
    CommandArgs:    {not applicable}
    FindMethod:     ById
    FindArgs        txtLastName
    </pre>
    <p><img alt="Example of the focus command in Excel." src="action_focus.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will set focus to the browser element with the id <span class="italic">txtLastName</span> to flash. The test will fail if no element with that id is found.
    </blockquote>
    
    <h3><a name="action_forward">Forward</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdGoForward
    Command:        Forward
    CommandArgs:    {not applicable}
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p><img alt="Example of the forward command in Excel." src="action_forward.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will navigate to the next page in the browser's history.
    </blockquote>
    
    <h3><a name="action_getcookie">GetCookie</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdGetCookie
    Command:        GetCookie
    CommandArgs:    http://www.google.co.uk,wax
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p><img alt="Example of the get cookie command in Excel." src="action_getcookie.png" /></p>
    
    <h4>Description</h4>
    
    <blockquote>
     This example will get the cookie named <span class="italic">wax</span> for the domain <span class="italic">http://www.google.co.uk</span>.
    </blockquote>
    
    <h3><a name="action_goto">Goto</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdGotoStart
    Command:        Goto
    CommandArgs:    http://wwww.google.co.uk
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p>CommandArgs: The url to navigate to. If '<span class="bold">~</span>' is found in the url it will be replaced with the current directory.</p>    
    <p><img alt="Example of the goto command in Excel." src="action_goto.png" /></p>
    
    <h4>Description</h4>
    
    <blockquote>
     <p>This example will navigate to <span class="italic">http://wwww.google.co.uk</span>.</p>
     <p><span class="bold">Note:</span> If there is no attached browser, i.e. <a href="action_attachtoie">AttachToIE</a> or <a href="action_goto">Goto</a> 
     have not been called before in the test, a new browser window will be created prior to navigation</p>
    </blockquote>
    
    <h3><a name="action_presstab">PressTab</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdPressTab
    Command:        PressTab
    CommandArgs:    {not applicable}
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p><img alt="Example of the press tab command in Excel." src="action_presstab.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will press the tab key moving focus to the next element in the tab order.
    </blockquote>
        
    <h3><a name="action_refresh">Refresh</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdRefresh
    Command:        Refresh
    CommandArgs:    {not applicable}
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    
    <p><img alt="Example of the refresh command in Excel." src="action_refresh.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will refresh the current browser window.
    </blockquote>

    <h3><a name="action_screenshot">Screenshot</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdScreenshot
    Command:        Screenshot
    CommandArgs:    C:\images\testimage1.png
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p><img alt="Example of the screen shot command in Excel." src="action_screenshot.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will create a screen shot of the current web page and save it to disk.
    </blockquote>
        
    <h3><a name="action_selecttext">SelectText</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdSelectText
    Command:        SelectText
    CommandArgs:    {not applicable}
    FindMethod:     ById
    FindArgs        txtFirstName
    </pre>
    <p><img alt="Example of the select text command in Excel." src="action_selecttext.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will select the text for the text input element identified by the id txtFirstName. The test will fail if no element is found for the corresponding id, or if that element is not a text input field.
    </blockquote>
        
    <h3><a name="action_setcookie">SetCookie</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdSetCookie
    Command:        SetCookie
    CommandArgs:    http://www.google.co.uk/,"wax=1234; expires=Wed, 01-Jan-2020 00:00:00 GMT"
    FindMethod:     {not applicable}
    FindArgs        {not applicable}
    </pre>
    <p><img alt="Example of the set cookie command in Excel." src="action_setcookie.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will set the cookie named <span class="italic">wax</span> to the value <span class="italic">1234</span> to expire on <span class="italic">1st Jan 2020</span> for the domain <span class="italic">http://www.google.co.uk</span>. <span class="bold">Note</span> the cookie data is enclosed in quotes because it contains a comma.
    </blockquote>
    
    <h3><a name="action_setvalue">SetValue</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdSetFirstName
    Command:        SetValue
    CommandArgs:    Edward,Text
    FindMethod:     ById
    FindArgs        txtFirstName
    </pre>
    <p>insert excel image</p>    
    <p><img alt="Example of the SetValue command in Excel." src="action_setvalue.png" /></p>
    <blockquote>
     This example sets the value of the the browser element with the id <span class="italic">txtLastName</span> to <span class="italic">Edward</span>. The test will fail if no element with that id is found.
    </blockquote>
    
    <h3><a name="action_setvalues">SetValues</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdSetMultiList
    Command:        SetValue
    CommandArgs:    Visa,MasterCard,SelectedItem
    FindMethod:     ById
    FindArgs        optCreditCards
    </pre>
    <p><img alt="Example of the SetValues command in Excel." src="action_setvalues.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example finds the select list with the id <span class="italic">txtLastName</span> and sets the selected items to <span class="italic">Visa and MasterCard</span>. The test will fail if no element with that id is found.
    </blockquote>
    
    <h3><a name="action_typetext">TypeText</a> <a href="#action_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdTypeText
    Command:        TypeText
    CommandArgs:    Eddie
    FindMethod:     ById
    FindArgs        txtFirstName
    </pre>
    <p><img alt="Example of the TypeText command in Excel." src="action_typetext.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example finds the text box with the id <span class="italic">txtTypeText</span> and types in the text <span class="italic">Eddie</span>. The test will fail if no element with that id is found.
    </blockquote>
    
    <h2><a name="assert_commands">Assertion commands</a><a href="#introduction" class="goto_top">^</a></h2>
    <table title="Action commands table">
        <caption>List of available assertion commands</caption>
        <thead>
            <tr>
                <th>Name</th>
                <th>Arguments</th>
                <th>Find method</th>
                <th>Description</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="table_item_def"><a href="#action_validate">Validate</a></td>
                <td>value, property name</td>
                <td>Required</td>
                <td>Asserts the value of an element's property is the same as the expected value</td>
            </tr>
            <tr class="alternate_row" >
                <td class="table_item_def"><a href="#action_validateusingattributes">Validate using attributes</a></td>
                <td>value, attribute:{name}</td>
                <td>Required</td>
                <td>Asserts the value of an element's attribute is the same as the expected value</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_validatelastfound">Validate last found value</a></td>
                <td>value</td>
                <td>Required</td>
                <td>Asserts the value of the last "Get" command (i.e. GetCookie, GetJavaDialogMessage) is the same as the expected value</td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_validateusingdocument">Validate document contains text</a></td>
                <td>value, text</td>
                <td>Required</td>
                <td>Asserts the document contains the specified value.</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#action_validateitems">ValidateItems</a></td>
                <td>values (comma seperated), property name</td>
                <td>Required</td>
                <td>Asserts values for elements that can have multiple values. Commonly used with a selected list that has the <span class="italic">multiple</span> attribute. </td>
            </tr>
        </tbody>
    </table>
    
    <h3>Examples using the assertion commands</h3>
    <h3><a name="action_validate">Validate</a> <a href="#assert_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdValidateLinkText
    Command:        Validate
    CommandArgs:    Save document,Text
    FindMethod:     ById
    FindArgs        linkSaveDocument
    </pre>
    <p><img alt="Example of the Validate command in Excel." src="action_validate.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will check that the link identified by the id <span class="italic">linkSaveDocument</span> has it's text property set to <span class="italic">Save document</span> 
     If the link can not be found or the link's text property is not set to this value then the test will fail.
    </blockquote>
    
    <h3><a name="action_validateusingattributes">Validate using attributes</a> <a href="#assert_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdValidateAttrubute
    Command:        Validate
    CommandArgs:    mainForm,attribute:class
    FindMethod:     ById
    FindArgs        form1
    </pre>
    <p><img alt="Example of the Validate command in Excel." src="action_validate2.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will check that the <span class="italic">attribute</span> called <span class="italic">class</span> is equal to <span class="italic">mainForm</span> 
    </blockquote>
    
    <h3><a name="action_validateusingdocument">Validate document contains text</a> <a href="#assert_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdValidateDocument
    Command:        Validate
    CommandArgs:    WatiN Home,Text
    FindMethod:     UsingDocument
    FindArgs        
    </pre>
    <p><img alt="Example of the Validate command in Excel." src="action_validateusingdocument.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will check that the <span class="italic">document</span> contains the text <span class="italic">UsingDocument</span>.
     The test will fail if the document doesn't contain this text.
    </blockquote>
    <blockquote>
    It's also possible to enter values using regular expressions see:<a href="http://msdn.microsoft.com/en-us/library/kweb790z(VS.71).aspx">http://msdn.microsoft.com/en-us/library/kweb790z(VS.71).aspx</a> for correct syntax.
    </blockquote>
    
    
    <h3><a name="action_validatelastfound">ValidateLastFound</a> <a href="#assert_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdLastFound
    Command:        ValidateLastFound
    CommandArgs:    wax=1234
    FindMethod:     
    FindArgs        
    </pre>
    <p><img alt="Example of the Validate command in Excel." src="action_validatelastfound.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example asserts that the value of the last get command, which retrieves a cookie, is equal to "wax=1234".
    </blockquote>
    
    <h3><a name="action_validateitems">ValidateItems</a> <a href="#assert_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdValidateSelectList
    Command:        ValidateItems
    CommandArgs:    1,2,3,SelectedItem
    FindMethod:     ById
    FindArgs        listOptions
    </pre>
    <p><img alt="Example of the Validate command in Excel." src="action_validateitems.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will check that the selected items of a list, identified by the id <span class="italic">listOptions</span> are <span class="italic">1, 2 and 3</span>;
     if otherwise the test will fail.
    </blockquote>
    
    <!-- Dialog commands section -->
    
    <h2><a name="dialog_commands">Dialog commands</a><a href="#introduction" class="goto_top">^</a></h2>
    <table title="Dialog commands table">
        <caption>List of available dialog commands</caption>
        <thead>
            <tr>
                <th>Name</th>
                <th>Arguments</th>
                <th>Find method</th>
                <th>Description</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="table_item_def"><a href="#attachdialog_command">AttachDialogHandler</a></td>
                <td>{dialog type},{dialog id}</td>
                <td></td>
                <td>Attaches a specified <a href="#dialogtypes">type</a> of dialog and assigns it a given id</td>
            </tr>
            <tr class="alternate_row" >
                <td class="table_item_def"><a href="#javadialog_getmessage">GetJavaDialogMessage</a></td>
                <td>{dialog type},{dialog id}</td>
                <td></td>
                <td>Using a previously attached simple SimpleJavaDialog get's its alert message</td>
            </tr>
        </tbody>
    </table>
    
    <h3><a name="dialogtypes">Dialog Types</a></h3>
    <table title="Dialog types">
        <caption>Types of dialogs that can be tested</caption>
        <thead>
            <tr>
                <th>Value</th>
                <th>Description</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>SimpleJavaDialog</td>
                <td>Used to test a javascript alert dialog, used in the <a href="#attachdialog_command"></a> and</td>
            </tr>
        </tbody>
    </table>
    <h3>Examples using the dialog commands</h3>
    
    <h3><a name="attachdialog_command">AttachDialogHandler</a> <a href="#dialog_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdAttachDlg1
    Command:        AttachDialogHandler
    CommandArgs:    SimpleJavaDialog,dlgSimple
    FindMethod:     
    FindArgs        
    </pre>
    <p><img alt="Example of using the attach dialog handler command." src="attachdialog_command.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This will attach a <span class="italic">SimpleJavaDialog</span> handler and assign it the id <span class="italic">dlgSimple</span>.
     The id allows subsequent commands to interact and reference this dialog.
    </blockquote>
    
    <h3><a name="javadialog_getmessage">GetJavaDialogMessage</a> <a href="#dialog_commands" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdAttachDlg2
    Command:        GetJavaDialogMessage
    CommandArgs:    SimpleJavaDialog,dlgSimple
    FindMethod:     
    FindArgs        
    </pre>
    <p><img alt="Example of using the java dialog get message command." src="javadialog_getmessage.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example shows how to attach a dialog, click a link that will cause the dialog to appear, and then retrieve it's message content and finally assert that it's equal to an expected value.
    </blockquote>
    
   
    <!-- End dialog commands section -->
    
    
    <h2><a name="findmethods">Find methods</a><a href="#introduction" class="goto_top">^</a></h2>
    <table title="Action commands table">
        <caption>List of available find methods</caption>
        <thead>
            <tr>
                <th>Name</th>
                <th>Arguments</th>
                <th>Description</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="table_item_def"><a href="#find_byid">ById</a></td>
                <td>{Id}</td>
                <td>Finds an element using the value of it's id.</td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#find_byvalue">ByValue</a></td>
                <td>{value}</td>
                <td>Finds an element by it's value</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#find_bylastelement">ByLastElement</a></td>
                <td></td>
                <td>Use the last element found from the previous command executed.</td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#find_byurl">ByUrl</a></td>
                <td></td>
                <td>Find an element based on the value of it's url</td>
            </tr>
            <tr>
                <td class="table_item_def"><a href="#find_bynameandvalue">ByNameAndValue</a></td>
                <td>{name, value}</td>
                <td>Find an element based on it's name and value.</td>
            </tr>
            <tr class="alternate_row">
                <td class="table_item_def"><a href="#action_validateusingdocument">UsingDocument</a></td>
                <td></td>
                <td>Used for validating properties at the document level see: <a href="#action_validateusingdocument">example validate UsingDocument</a></td>
            </tr>
        </tbody>
    </table>
        
    <h3>Examples using the find methods</h3>
    
    <h3><a name="find_byid">FindById</a> <a href="#findmethods" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdFindByTest
    Command:        Click
    CommandArgs:    
    FindMethod:     ById
    FindArgs        link1
    </pre>
    <p><img alt="Example of using the FindById method to locate an element." src="find_byid.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will locate an element by it's <span class="italic">id</span>.
     If no matching id is found then the test will fail.
    </blockquote>
    
    
    <h3><a name="find_bylastelement">FindByLastElement</a> <a href="#findmethods" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdFindByLastElement
    Command:        Click
    CommandArgs:    
    FindMethod:     ByLastElement
    FindArgs        
    </pre>
    <p><img alt="Example of using the find by last element method to locate an element." src="find_bylastelement.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will use the last element found and fire its click event.
    </blockquote>
    
    <h3><a name="find_byurl">FindByUrl</a> <a href="#findmethods" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdFindByUrl
    Command:        Click
    CommandArgs:    
    FindMethod:     ByUrl
    FindArgs        http://www.google.co.uk
    </pre>
    <p><img alt="Example of using the find by url method to locate an element." src="find_byurl.png" /></p>
    <h4>Description</h4>
    <blockquote>
     This example will use the element that has an <span class="italic">href</span> of "http://www.google.co.uk" and fire its click event.
     If no such element is found the test will fail.
    </blockquote>
    
    <h3><a name="find_byvalue">FindByValue</a> <a href="#findmethods" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdFindByValue
    Command:        Click
    CommandArgs:    
    FindMethod:     ByValue
    FindArgs        3
    </pre>
    <p><img alt="Example of using the FindByValue method to locate an element." src="find_byvalue.png" /></p>
    <h4>Description</h4>
    <blockquote>
     <p>This example will locate an element by it's <span class="italic">value</span>.
     If no matching value is found then the test will fail.</p>
     
     <p>This example would match the following html fragment:<br />
        <code>	&lt;input type="Radio" name="radio1" value="3"&gt; </code>
     </p>
    </blockquote>
    
    
    <h3><a name="find_bynameandvalue">FindByNameValue</a> <a href="#findmethods" class="goto_top">^</a></h3>
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdFindByNameValue
    Command:        Click
    CommandArgs:    
    FindMethod:     ByNameValue
    FindArgs        radio1, 3
    </pre>
    <p><img alt="Example of using the FindByNameAndValue method to locate an element." src="find_bynameandvalue.png" /></p>
    <h4>Description</h4>
    <blockquote>
     <p>This example will locate an element by it's <span class="italic">name and value</span>.
     If no matching element is found then the test will fail.</p>
     
     <p>This example would match the following html fragment:<br />
        <code>	&lt;input type="Radio" name="radio1" value="3"&gt; </code>
     </p>
    </blockquote>
    
    <h3><a name="settingscommand">Settings command</a> <a href="#settings" class="goto_top">^</a></h3>
    
      <table title="Action commands table">
        <caption>List of available settings</caption>
        <thead>
            <tr>
                <th>Name</th>
                <th>Description</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>AttachToIETimeOut</td>
                <td>Time to wait whilst trying to attach to an instance of IE.</td>
            </tr>
            <tr class="alternate_row">
                <td>AutoCloseDialogs</td>
                <td>Automatically close any dialogs opened during a test</td>
            </tr>           
        </tbody>
       </table>    
    
    <h4>Example usage:</h4>
    <pre>
    Command Id:     CmdFindByNameValue
    Command:        Click
    CommandArgs:    
    FindMethod:     ByNameValue
    FindArgs        radio1, 3
    </pre>
    <p><img alt="Example of using the FindByNameAndValue method to locate an element." src="find_bynameandvalue.png" /></p>
    <h4>Description</h4>
    <blockquote>
     <p>This example will locate an element by it's <span class="italic">name and value</span>.
     If no matching element is found then the test will fail.</p>
    
    </blockquote>
    
</body>
</html>
